package com.hqd.ch03.v41.context.i18n;

import com.hqd.ch03.v41.web.servlet.i18n.SimpleLocaleContext;

import java.util.Locale;
import java.util.TimeZone;

public class SimpleTimeZoneAwareLocaleContext extends SimpleLocaleContext implements TimeZoneAwareLocaleContext {

    /**
     * 时区
     */
    private final TimeZone timeZone;


    public SimpleTimeZoneAwareLocaleContext(Locale locale, TimeZone timeZone) {
        super(locale);
        this.timeZone = timeZone;
    }


    @Override

    public TimeZone getTimeZone() {
        return this.timeZone;
    }

    @Override
    public String toString() {
        return super.toString() + " " + (this.timeZone != null ? this.timeZone.toString() : "-");
    }

}
